Comparison of regular expression engines
Libraries
- ^ formerly called Regex++
- ^ a b one of fuzzy regular expression engines
- ^ included since version 2.13.0
- ^ C++ bindings were developed by Google and became officially part of PCRE in 2006
Languages
Language features
NOTE: An application using a library for regular expression support does not necessarily offer the full set of features of the library, e.g. GNU Grep which uses PCRE does not offer lookahead support, though PCRE does.
Part 1
Language feature comparison (part 1)
|
"+" quantifier |
Negated character classes |
Non-greedy quantifiers[Note 1] |
Shy groups[Note 2] |
Recursion |
Lookahead |
Lookbehind |
Backreferences[Note 3] |
>9 indexable captures |
Boost.Regex |
Yes |
Yes |
Yes |
Yes |
Yes [Note 4] |
Yes |
Yes |
Yes |
Yes |
Boost.Xpressive |
Yes |
Yes |
Yes |
Yes |
Yes [Note 5] |
Yes |
Yes |
Yes |
Yes |
CL-PPCRE |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
EmEditor |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
No |
FREJ |
No [Note 6] |
No |
Some [Note 6] |
Yes |
No |
No |
No |
Yes |
Yes |
GLib/GRegex |
Yes |
? |
Yes |
? |
No |
? |
? |
? |
? |
GNU Grep |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
? |
Haskell |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
Java |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
ICU Regex |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
JGsoft |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
.NET |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
OCaml |
Yes |
Yes |
No |
No |
No |
No |
No |
Yes |
No |
OmniOutliner 3.6.2 |
Yes |
Yes |
Yes |
No |
No |
No |
No |
? |
? |
PCRE |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Perl |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
PHP |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Python |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
Qt/QRegExp |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
No |
Yes |
Yes |
re2 |
Yes |
Yes |
Yes |
Yes |
No |
No |
No |
No |
Yes |
Ruby |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
TRE |
Yes |
Yes |
Yes |
Yes |
No |
No |
No |
Yes |
No |
Vim 7.3a (2010-05-24) |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
No |
RGX |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
TRegExpr |
Yes |
? |
Yes |
? |
? |
? |
? |
? |
? |
Part 2
- ^ Also known as Flags modifiers or Option letters. Example pattern: "(?i:test)"
- ^ Also called Independent sub-expressions
- ^ Similar to back references but with names instead of indices
- ^ a b c Requires optional Unicode support enabled.
- ^ a b c d e f g h Supports only a subset of Unicode properties, not all of them.
- ^ Available as of JDK7.
- ^ a b Supports all Unicode properties, including non-binary properties.
- ^ Available as of PCRE 7.0 (as of PCRE 4.0 with Python-like syntax
(?P<name>...)
)
- ^ Available as of perl 5.9.5
API features
API feature comparison
|
Native UTF-16 support |
Native UTF-8 support |
Non-linear input support |
Dot-matches-newline option |
Anchor-matches-newline option |
Boost.Regex |
No |
No |
Yes |
Yes |
Yes |
GLib/GRegex |
No |
Yes [Note 1] |
No |
Yes |
Yes |
ICU Regex |
Yes |
No |
Yes |
Yes |
Yes |
Java |
Yes |
No |
Yes |
Yes |
Yes |
.NET |
No [Note 2] |
No |
Yes |
Yes |
Yes |
PCRE |
No |
Yes [Note 1] |
No |
Yes |
Yes |
Qt/QRegExp |
Yes |
No |
No |
No |
No |
TRE |
No |
? |
Yes |
Yes |
Yes |
RGX |
No |
No |
? |
Yes |
Yes |
- ^ a b Requires optional Unicode support enabled.
- ^ Implementation is incorrect - it treats UTF-16 code units as characters, so characters outside the BMP don't work properly. See, for example, this bug report [1].
See also
External links